package com.evan.wj.pojo;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
import java.io.Serializable;

@Entity
@Table(name = "bookshelf")
@IdClass(Bookshelf.class)
public class Bookshelf implements Serializable {
    @Id
    private int userId;
    @Id
    private int bookId;

    public Bookshelf() {
        super();
    }

    public Bookshelf(int userId, int bookId) {
        super();
        this.userId = userId;
        this.bookId = bookId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public int getBookId() {
        return bookId;
    }

    public void setBookId(int bookId) {
        this.bookId = bookId;
    }

    @Override
    public String toString() {
        return "Bookshelf{" +
                "userId=" + userId +
                ", bookId=" + bookId +
                '}';
    }
}
